/* 
var str = 'a';
var pos = str.charCodeAt(e);
console.log(pos);
写一个函数，接收任意一个字符串，算出这个字符串的总字节数
*/
function comcputeByte(str){
    let count=0
    for (let index = 0; index < str.length; index++) {
        let pos =str.charCodeAt(index) ;
        count+=(pos>255)?2:1;
        
    }
    console.log(count);
    
}
comcputeByte("hello world")
comcputeByte("你好世界")